package gang.org.springframework.boot.autoconfigure;

import gang.org.springframework.framework.metadata.GangAnnotationMetadata;

public interface GangDeferredImportSelector extends GangImportSelector {

    default Class<? extends Group> getImportGroup(){
        return null;
    }

    interface Group
    {
        void process(GangAnnotationMetadata metadata, GangDeferredImportSelector selector);

        /**
         * 业务意义
         * Entry用于封装工厂资源类名（全路径）的元信息
         * */
        class Entry{
            private final String importClassName;
            private final GangAnnotationMetadata metadata;

            public Entry(String importClassName, GangAnnotationMetadata metadata) {
                this.importClassName = importClassName;
                this.metadata = metadata;
            }

            public String getImportClassName() {
                return this.importClassName;
            }

            public GangAnnotationMetadata getMetadata() {
                return this.metadata;
            }
        }

        Iterable<Entry> selectImport();
    }
}
